package junghoAndI;
/*
 * 패키지 이름 적절히 바꾸세요
 */


import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.FlowLayout;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.border.LineBorder;
import javax.swing.table.DefaultTableModel;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.sql.Savepoint;
import java.util.ArrayList;

public class DogMain extends JFrame {

	
	private JPanel contentPane;
	JTable dogTable;		// 유기견 테이블
	private JTable empTable;		// 직원 테이블
	private JTable adoTable;		// 입양자 테이블
	private JTextField Id;			// 로그인 화면에서 아이디 입력 필드
	private JPasswordField pwd;		// 로그인 화면에서 비밀번호 입력 필드
	private JButton loginBtn; 		// 로그인 화면에서 로그인 버튼
	private JButton regBtn; 		// 로그인 화면에서 회원 가입 버튼
	private JTextField searchBtn;	// 로그아웃 화면에서 검색 버튼
	private JButton logoutBtn;		// 로그아웃 화면에서 로그아웃 버튼
	private JLabel txtInfo;			// 로그아웃 화면에서 사용자 이름이나 정보가 표시되는 라벨
	
	private DogDAO ddao = new DogDAO();
	private DefaultTableModel model = new DefaultTableModel();
	private DogVO m = new DogVO();
	private JTextField dId;
	private JTextField name;
	private JTextField collar;
	private JTextField age;
	private JTextField tno;
	private JTextField sex;
	private JTextField regdate;
	private JTextField etc;
	private JTextField specificloc;
	private JTextField mercykilling;
	private JTextField sno;
	private JTextField imgName;
	private JLabel ImgLabel = new JLabel();
	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					DogMain frame = new DogMain();
					frame.setVisible(true);
			
					
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}
	
	
	/*
	 * 기본 생성자
	 */
	public DogMain(){
		initialize();
	}
	
	/*
	 * Create the frame.
	 * 
	 * 기본 판넬 구조
	 * contentPane	- headpanel ; 윗 부분 개그림 레이블이 들어가는 판넬
	 * 				- memberPanel ; 로그인 폼이 들어가는 판넬
	 * 							- loginPanel ; 로그인 화면이 표시되는 판넬
	 * 							- logoutPanel ; 로그인 후의 화면이 표시되는 판넬
	 * 				- mainPanel	; 아랫 부분이 주요 내용들이 표시되는 판넬 cardLayout으로 구성
	 * 							- tabPanel ; 각 탭들이 들어가는 판넬
	 * 							- indexPanel ; 프로그램 최초 구동시 표시되는 판넬
	 * 							- myPanel ; 회원 정보 수정 및 삭제를 표시하는 판넬
	 * 							- adminpanel ; 관리자용 관리 페이지가 표시되는 판넬
	 */				
	private void initialize() {
		setTitle("유기견 관리 프로그램");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 1024, 768);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		
		JPanel headPanel = new JPanel();
		headPanel.setMaximumSize(new Dimension(32767, 200));
		headPanel.setPreferredSize(new Dimension(10, 100));
		headPanel.setBackground(Color.LIGHT_GRAY);
		contentPane.add(headPanel, BorderLayout.NORTH);
		
		JPanel memberPanel = new JPanel();
		memberPanel.setMaximumSize(new Dimension(32767, 100));
		contentPane.add(memberPanel, BorderLayout.CENTER);
		memberPanel.setLayout(new CardLayout(0, 0));
		
		JPanel loginPanel = new JPanel();
		FlowLayout flowLayout = (FlowLayout) loginPanel.getLayout();
		flowLayout.setVgap(20);
		flowLayout.setHgap(20);
		flowLayout.setAlignment(FlowLayout.LEFT);
		memberPanel.add(loginPanel, "loginPanel");
		
		JLabel txtId = new JLabel("아이디");
		loginPanel.add(txtId);
		
		Id = new JTextField();
		loginPanel.add(Id);
		Id.setColumns(10);
		
		JLabel txtBlank1 = new JLabel("    ");
		loginPanel.add(txtBlank1);
		
		JLabel txtPwd = new JLabel("비밀번호");
		loginPanel.add(txtPwd);
		
		pwd = new JPasswordField();
		loginPanel.add(pwd);
		pwd.setColumns(10);
		
		JLabel txtBlank2 = new JLabel("    ");
		loginPanel.add(txtBlank2);
		
		loginBtn = new JButton("로그인");
		loginPanel.add(loginBtn);
		
		JLabel txtBlank3 = new JLabel("    ");
		loginPanel.add(txtBlank3);
		
		regBtn = new JButton("회원가입");
		loginPanel.add(regBtn);
		
		JPanel logoutPanel = new JPanel();
		FlowLayout flowLayout_1 = (FlowLayout) logoutPanel.getLayout();
		flowLayout_1.setVgap(20);
		flowLayout_1.setHgap(20);
		flowLayout_1.setAlignment(FlowLayout.LEFT);
		memberPanel.add(logoutPanel, "logoutPanel");
		
		txtInfo = new JLabel("000님 로그인 하셨습니다.");
		logoutPanel.add(txtInfo);
		
		logoutBtn = new JButton("로그아웃");
		logoutPanel.add(logoutBtn);
		
		JLabel txtSearch = new JLabel("검색");
		logoutPanel.add(txtSearch);
		
		searchBtn = new JTextField();
		logoutPanel.add(searchBtn);
		searchBtn.setColumns(10);
		
		
		
		

		/*
		 * 메인 부분의 표시 패널
		 */
		JPanel mainPanel = new JPanel();
		mainPanel.setPreferredSize(new Dimension(10, 550));
		contentPane.add(mainPanel, BorderLayout.SOUTH);
		mainPanel.setLayout(new CardLayout(0, 0));
		
		

		/*
		 * 탭 패널 설정
		 */
		JTabbedPane tabPanel = new JTabbedPane(JTabbedPane.TOP);
		mainPanel.add(tabPanel, "tabPanel");
		
		
		

		/*
		 * 유기견 관리 패널
		 */
		JPanel dogPanel = new JPanel();
		tabPanel.addTab("DOG", null, dogPanel, null);
		dogPanel.setLayout(new BorderLayout(0, 0));
		
		JScrollPane dogScroll = new JScrollPane();
		dogScroll.setPreferredSize(new Dimension(500, 200));
		dogPanel.add(dogScroll, BorderLayout.NORTH);
		{	
			
			
			
			ArrayList<DogVO> list = ddao.selectDog();
			
					
			model = new DefaultTableModel(){
				@Override
				public boolean isCellEditable(int row, int column) {							
					return false;	// 모든 열을 수정불가!!
				}
			};
			
			model.setColumnIdentifiers(new String[]{"번호","이름","성별","종류","나이", "발견지", "담당보호소", "안락사여부"});
			
			for(DogVO m : list){
				model.addRow(new String []{m.getID(), m.getDname(), m.getSex(), m.getTno(), m.getAge(), m.getFno(), m.getSno(), m.getMercykilling()});
			}
			dogTable = new JTable();
			
			dogTable.setModel(model); 
		}
		
		
		dogTable.setPreferredScrollableViewportSize(new Dimension(32767, 32767));
		dogTable.setPreferredSize(new Dimension(2, 200));
		dogScroll.setViewportView(dogTable);
		
		
		
		dogTable.addMouseListener(new MouseAdapter() {
			
			@Override
			public void mouseClicked(MouseEvent e) {
				JTable t = (JTable)e.getSource();
				if(e.getClickCount()==2){
					JOptionPane.showMessageDialog(null, "상세정보는 좌하단에 표시됩니다");
					dogTable.setSelectionBackground(new Color(255, 0 ,0));
				
				int r = dogTable.getSelectedRow();
				String id = dogTable.getValueAt(r, 0).toString();
				m = new DogVO();
				m = ddao.selectOneDog(id);
				dId.setText(m.getID());
				name.setText(m.getDname());
				collar.setText(m.getCollar());
				age.setText(m.getAge());
				sex.setText(m.getSex());
				tno.setText(m.getTno());
				regdate.setText(m.getRegdate());
				etc.setText(m.getEtc());
				specificloc.setText(m.getSpecificloc());
				mercykilling.setText(m.getMercykilling());
				sno.setText(m.getSno());
				imgName.setText(m.getPhoto());
				ImgLabel.setIcon(new ImageIcon(m.getPhoto()));
				
				}
				
			}
		});
		
		
		
		
		
		
		JPanel dogDetail = new JPanel();
		dogDetail.setPreferredSize(new Dimension(690, 10));
		dogPanel.add(dogDetail, BorderLayout.WEST);
		
		
		JLabel txtDid = new JLabel("ID");
		
		dId = new JTextField();
		dId.setColumns(10);
		
		
		
		
		JLabel txtName = new JLabel("이름");
		
		name = new JTextField();
		name.setColumns(10);
		
		JLabel txtCollar = new JLabel("목걸이");
		
		collar = new JTextField();
		collar.setColumns(10);
		
		JLabel txtAge = new JLabel("나이");
		
		age = new JTextField();
		age.setColumns(10);
		
		JLabel txtSex = new JLabel("성별");
		
		tno = new JTextField();
		tno.setColumns(10);
		
		JLabel txtTno = new JLabel("종류");
		
		sex = new JTextField();
		sex.setColumns(10);
		
		JLabel txtRegdate = new JLabel("등록일");
		
		regdate = new JTextField();
		regdate.setColumns(10);
		
		JLabel txtEtc = new JLabel("비고");
		
		etc = new JTextField();
		etc.setColumns(10);
		
		JLabel txtSpecificloc = new JLabel("발견지(상세)");
		
		specificloc = new JTextField();
		specificloc.setColumns(10);
		
		JLabel txtMercykilling = new JLabel("안락사여부");
		
		mercykilling = new JTextField();
		mercykilling.setColumns(10);
		
		JLabel txtSno = new JLabel("담당보호소");
		
		sno = new JTextField();
		sno.setColumns(10);
		
		
		ImgLabel.setBorder(new LineBorder(Color.LIGHT_GRAY));
		
		imgName = new JTextField();
		imgName.setColumns(10);
		
		GroupLayout gl_dogDetail = new GroupLayout(dogDetail);
		gl_dogDetail.setHorizontalGroup(
			gl_dogDetail.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_dogDetail.createSequentialGroup()
					.addContainerGap()
					.addGroup(gl_dogDetail.createParallelGroup(Alignment.LEADING)
						.addGroup(gl_dogDetail.createSequentialGroup()
							.addGroup(gl_dogDetail.createParallelGroup(Alignment.LEADING)
								.addGroup(gl_dogDetail.createSequentialGroup()
									.addComponent(txtRegdate)
									.addGap(5)
									.addComponent(regdate, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addGroup(gl_dogDetail.createSequentialGroup()
									.addGap(204)
									.addComponent(txtCollar)))
							.addPreferredGap(ComponentPlacement.RELATED, 406, Short.MAX_VALUE))
						.addGroup(gl_dogDetail.createSequentialGroup()
							.addGroup(gl_dogDetail.createParallelGroup(Alignment.LEADING)
								.addGroup(gl_dogDetail.createSequentialGroup()
									.addComponent(txtTno)
									.addGap(18)
									.addComponent(tno, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
									.addGap(46)
									.addComponent(txtEtc)
									.addPreferredGap(ComponentPlacement.RELATED, 69, Short.MAX_VALUE)
									.addComponent(etc, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addGroup(gl_dogDetail.createSequentialGroup()
									.addComponent(txtSex)
									.addGap(18)
									.addComponent(sex, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
									.addGap(46)
									.addComponent(txtSno)
									.addPreferredGap(ComponentPlacement.RELATED, 33, Short.MAX_VALUE)
									.addComponent(sno, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addGroup(gl_dogDetail.createSequentialGroup()
									.addComponent(txtAge)
									.addGap(18)
									.addComponent(age, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addGroup(gl_dogDetail.createSequentialGroup()
									.addGroup(gl_dogDetail.createParallelGroup(Alignment.LEADING)
										.addGroup(gl_dogDetail.createSequentialGroup()
											.addComponent(txtDid)
											.addGap(31)
											.addComponent(dId, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
										.addGroup(gl_dogDetail.createSequentialGroup()
											.addComponent(txtName)
											.addGap(18)
											.addComponent(name, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
									.addGap(23)
									.addGroup(gl_dogDetail.createParallelGroup(Alignment.LEADING)
										.addGroup(gl_dogDetail.createSequentialGroup()
											.addComponent(txtMercykilling)
											.addPreferredGap(ComponentPlacement.RELATED, 33, Short.MAX_VALUE)
											.addComponent(mercykilling, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
										.addGroup(gl_dogDetail.createSequentialGroup()
											.addComponent(txtSpecificloc)
											.addPreferredGap(ComponentPlacement.RELATED, 23, Short.MAX_VALUE)
											.addComponent(specificloc, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))))
								.addComponent(collar, Alignment.TRAILING, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
							.addPreferredGap(ComponentPlacement.RELATED, 97, Short.MAX_VALUE)
							.addGroup(gl_dogDetail.createParallelGroup(Alignment.LEADING)
								.addComponent(ImgLabel, Alignment.TRAILING, GroupLayout.PREFERRED_SIZE, 136, GroupLayout.PREFERRED_SIZE)
								.addGroup(Alignment.TRAILING, gl_dogDetail.createSequentialGroup()
									.addComponent(imgName, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
									.addGap(12)))))
					.addGap(32))
		);
		gl_dogDetail.setVerticalGroup(
			gl_dogDetail.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_dogDetail.createSequentialGroup()
					.addContainerGap()
					.addGroup(gl_dogDetail.createParallelGroup(Alignment.LEADING)
						.addGroup(gl_dogDetail.createSequentialGroup()
							.addGroup(gl_dogDetail.createParallelGroup(Alignment.BASELINE)
								.addComponent(txtDid)
								.addComponent(dId, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
								.addComponent(txtSpecificloc)
								.addComponent(specificloc, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
							.addGap(21)
							.addGroup(gl_dogDetail.createParallelGroup(Alignment.BASELINE)
								.addComponent(txtMercykilling)
								.addComponent(mercykilling, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
								.addComponent(txtName)
								.addComponent(name, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
							.addGap(32)
							.addGroup(gl_dogDetail.createParallelGroup(Alignment.TRAILING)
								.addComponent(txtSno)
								.addGroup(gl_dogDetail.createParallelGroup(Alignment.BASELINE)
									.addComponent(txtSex)
									.addComponent(sex, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addComponent(sno, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
							.addGap(31)
							.addGroup(gl_dogDetail.createParallelGroup(Alignment.TRAILING)
								.addGroup(gl_dogDetail.createParallelGroup(Alignment.BASELINE)
									.addComponent(txtTno)
									.addComponent(tno, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addGroup(gl_dogDetail.createSequentialGroup()
									.addGroup(gl_dogDetail.createParallelGroup(Alignment.BASELINE)
										.addComponent(txtEtc)
										.addComponent(etc, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
									.addGap(3))))
						.addGroup(gl_dogDetail.createSequentialGroup()
							.addComponent(ImgLabel, GroupLayout.PREFERRED_SIZE, 149, GroupLayout.PREFERRED_SIZE)
							.addGap(18)
							.addComponent(imgName, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
					.addPreferredGap(ComponentPlacement.RELATED, 7, Short.MAX_VALUE)
					.addGroup(gl_dogDetail.createParallelGroup(Alignment.LEADING)
						.addGroup(gl_dogDetail.createSequentialGroup()
							.addGap(3)
							.addComponent(txtRegdate))
						.addComponent(regdate, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addGroup(gl_dogDetail.createSequentialGroup()
							.addGap(3)
							.addGroup(gl_dogDetail.createParallelGroup(Alignment.BASELINE)
								.addComponent(txtCollar)
								.addComponent(collar, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))))
					.addGap(30)
					.addGroup(gl_dogDetail.createParallelGroup(Alignment.BASELINE)
						.addComponent(txtAge)
						.addComponent(age, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addGap(41))
		);
		dogDetail.setLayout(gl_dogDetail);
		
		JPanel dogMenu = new JPanel();
		dogMenu.setPreferredSize(new Dimension(300, 10));
		dogPanel.add(dogMenu, BorderLayout.EAST);
		dogMenu.setLayout(new BorderLayout(0, 0));
		
		JPanel managerPane = new JPanel();
		managerPane.setPreferredSize(new Dimension(10, 40));
		dogMenu.add(managerPane, BorderLayout.NORTH);
		
		JLabel managerLable = new JLabel(":: 메뉴 :: 관리자 일반회원 활성분류");
		GroupLayout gl_managerPane = new GroupLayout(managerPane);
		gl_managerPane.setHorizontalGroup(
			gl_managerPane.createParallelGroup(Alignment.TRAILING)
				.addGroup(gl_managerPane.createSequentialGroup()
					.addContainerGap(58, Short.MAX_VALUE)
					.addComponent(managerLable)
					.addGap(50))
		);
		gl_managerPane.setVerticalGroup(
			gl_managerPane.createParallelGroup(Alignment.TRAILING)
				.addGroup(gl_managerPane.createSequentialGroup()
					.addContainerGap(15, Short.MAX_VALUE)
					.addComponent(managerLable)
					.addContainerGap())
		);
		managerPane.setLayout(gl_managerPane);
		
		JPanel managerMainPane = new JPanel();
		dogMenu.add(managerMainPane, BorderLayout.WEST);
		
		JButton insertBtn = new JButton("애완견 등록(INSERT)");
		insertBtn.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				JOptionPane.showMessageDialog(null, "애견정보입력창으로 이동합니다");
				InsertDog insert = new InsertDog(model, dogTable);
				// dispose(); // 얘는 그냥 보이게 두는 편이 낫지 않나?
				insert.setVisible(true);
			}
		});
		
		JButton updateBtn = new JButton("애완견 수정(UPDATE)");
		updateBtn.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				int r = dogTable.getSelectedRow();
				if (r == -1) {
					JOptionPane.showMessageDialog(null, "수정할 줄을 눌러 주세요");
					return;
				}
				String id =	dogTable.getValueAt(r, 0).toString();
				if ( r != -1 ) {
					UpdateDog udg = new UpdateDog( id, r, dogTable );
					udg.setVisible(true);
				}
			}
		});
		
		JButton deleteBtn = new JButton("목록 삭제");
		deleteBtn.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				int r = dogTable.getSelectedRow();
				if (r == -1) {
					JOptionPane.showMessageDialog(null, "삭제할 행을 선택해 주세요");
					return;
				}
				int choice = JOptionPane.showConfirmDialog(null, "정말 삭제하실건가요?");
				if (choice == JOptionPane.OK_OPTION) {
					String id = dogTable.getValueAt(r, 0).toString();
					if (ddao.deleteDog(id) > 0) {
						JOptionPane.showMessageDialog(null, "삭제되었습니다");
						model.removeRow(r);
						dogTable.repaint();
					}
				}
			}
		});
		
		JButton dieOX = new JButton("안락사 확인");
		dieOX.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				JOptionPane.showMessageDialog(null, "안락사 되지 않은 강아지만 검색합니다");
				ArrayList<DogVO> lista = ddao.mercykillingDog();
				model = new DefaultTableModel();
				
				model = new DefaultTableModel(){
					@Override
					public boolean isCellEditable(int row, int column) {							
						return false;	// 모든 열을 수정불가!!
					}
				};
				
				model.setColumnIdentifiers(new String[]{"번호","이름","성별","종류","나이", "발견지", "담당보호소", "안락사여부"});
				
				
				for(DogVO m : lista){
					model.addRow(new String []{m.getID(), m.getDname(), m.getSex(), m.getTno(), m.getAge(), m.getFno(), m.getSno(), m.getMercykilling()});
				}
				dogTable.repaint();
				dogTable.setModel(model);
				
			}
		});
		GroupLayout gl_managerMainPane = new GroupLayout(managerMainPane);
		gl_managerMainPane.setHorizontalGroup(
			gl_managerMainPane.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_managerMainPane.createSequentialGroup()
					.addGap(66)
					.addGroup(gl_managerMainPane.createParallelGroup(Alignment.LEADING)
						.addGroup(gl_managerMainPane.createSequentialGroup()
							.addComponent(insertBtn, GroupLayout.DEFAULT_SIZE, 162, Short.MAX_VALUE)
							.addContainerGap())
						.addGroup(gl_managerMainPane.createSequentialGroup()
							.addComponent(updateBtn, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
							.addContainerGap())
						.addGroup(gl_managerMainPane.createSequentialGroup()
							.addComponent(dieOX, GroupLayout.PREFERRED_SIZE, 172, GroupLayout.PREFERRED_SIZE)
							.addContainerGap())
						.addGroup(Alignment.TRAILING, gl_managerMainPane.createSequentialGroup()
							.addComponent(deleteBtn, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
							.addContainerGap())))
		);
		gl_managerMainPane.setVerticalGroup(
			gl_managerMainPane.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_managerMainPane.createSequentialGroup()
					.addGap(23)
					.addComponent(insertBtn)
					.addGap(47)
					.addComponent(updateBtn)
					.addPreferredGap(ComponentPlacement.RELATED, 61, Short.MAX_VALUE)
					.addComponent(deleteBtn)
					.addGap(48)
					.addComponent(dieOX)
					.addContainerGap())
		);
		managerMainPane.setLayout(gl_managerMainPane);
		
		

		/*
		 * 직원 관리 패널
		 */
		JPanel empPanel = new JPanel();
		tabPanel.addTab("EMPLOYEE", null, empPanel, null);
		empPanel.setLayout(new BorderLayout(0, 0));
		
		JScrollPane empScroll = new JScrollPane();
		empScroll.setPreferredSize(new Dimension(2, 200));
		empPanel.add(empScroll, BorderLayout.NORTH);
		
		empTable = new JTable();
		empTable.setPreferredSize(new Dimension(0, 200));
		empScroll.setViewportView(empTable);
		
		JPanel empDetail = new JPanel();
		empDetail.setPreferredSize(new Dimension(490, 10));
		empPanel.add(empDetail, BorderLayout.WEST);
		
		JPanel empMenu = new JPanel();
		empMenu.setPreferredSize(new Dimension(500, 10));
		empPanel.add(empMenu, BorderLayout.EAST);

		
		
		/*
		 * 입양자 관리 패널
		 */
		JPanel adoPenel = new JPanel();
		tabPanel.addTab("ADOPTER", null, adoPenel, null);
		adoPenel.setLayout(new BorderLayout(0, 0));
		
		JScrollPane adoScroll = new JScrollPane();
		adoScroll.setPreferredSize(new Dimension(2, 200));
		adoPenel.add(adoScroll, BorderLayout.NORTH);
		
		adoTable = new JTable();
		adoTable.setPreferredSize(new Dimension(0, 200));
		adoScroll.setViewportView(adoTable);
		
		JPanel adoDetail = new JPanel();
		adoDetail.setPreferredSize(new Dimension(490, 10));
		adoPenel.add(adoDetail, BorderLayout.WEST);
		
		JPanel adoMenu = new JPanel();
		adoMenu.setPreferredSize(new Dimension(500, 10));
		adoPenel.add(adoMenu, BorderLayout.EAST);

		
		
		/*
		 * 게시판 탭 패널
		 * 추후 구현 예정
		 */
		JPanel boardPenel = new JPanel();
		tabPanel.addTab("BOARD", null, boardPenel, null);
		
		
		
		
		/*
		 * 프로그램 최초 실행시 표시되는 패널
		 */
		JPanel indexPanel = new JPanel();
		mainPanel.add(indexPanel, "indexPanel");
		indexPanel.setLayout(new BorderLayout(0, 0));
		
		JPanel indexDog = new JPanel();
		indexPanel.add(indexDog, BorderLayout.WEST);
		
		JPanel indexBbs = new JPanel();
		indexPanel.add(indexBbs, BorderLayout.EAST);
		
		
		
		
		/*
		 * 회원 정보 표시 패널 
		 */
		JPanel myPanel = new JPanel();
		mainPanel.add(myPanel, "myPanel");
		
		
		
		
		/*
		 * 관리자 페이지 패널
		 */
		JPanel adminPanel = new JPanel();
		mainPanel.add(adminPanel, "adminPanel");
	}
}
